package com.lzw.mapper.admin;

import com.lzw.pojo.Medicines;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MedicinesManage2Mapper {
    List<Medicines> list(@Param("name") String name, @Param("batchNumber") String batchNumber, @Param("manufacturer") String manufacturer, @Param("supplier") String supplier);

    void delete(@Param("ids") List<Integer> ids);

    @Insert("INSERT INTO pharmacymanagement.medicines(name, batch_number, manufacturer, quantity, price, supplier, sale_quantity,image) VALUES (#{name}, #{batchNumber}, #{manufacturer}, #{quantity}, #{price}, #{supplier}, #{saleQuantity}, #{image})")
    void add(Medicines medicines);

    void update(Medicines medicines);

    @Select("SELECT * FROM pharmacymanagement.medicines WHERE medicine_id = #{medicineId}")
    Medicines getById(Integer medicineId);
}
